import axios from '../utils/axios'

export const getQrCode = () =>
  axios.get<{ dataUrl: string; uuid: string }>('qrcode/generate')

export const checkQrCodeStatus = (uuid: string) =>
  axios.get<{ status: string }>(`qrcode/check?uuid=${uuid}`)

export const scanQrCode = (uuid: string) =>
  axios.get<{ status: string }>(`qrcode/scan?uuid=${uuid}`)

export const cancelScanQrCode = (uuid: string) =>
  axios.get<{ status: string }>(`qrcode/cancel?uuid=${uuid}`)

export const confirmScanQrCode = (uuid: string) =>
  axios.get<{ status: string }>(`qrcode/confirm?uuid=${uuid}`)
